<!DOCTYPE html>
<html lang="zh-cmn-Hans">
    <head>
        <title>我的畅校园</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
        <meta http-equiv="Cache-Control" content="no-siteapp">
        <meta name="keywords" content="西邮,西邮图书馆查询,畅校园,一站式校园生活平台,西邮图书馆">
        <meta name="description" content="西邮,西邮图书馆查询系统,畅校园,一站式校园生活平台,西邮图书馆">
        <meta name="author" content="droiz, zhengrenzhe@creatshare.com">
        <meta name="robots" content="index, follow">
        <link rel="stylesheet" href="css/stylesheets/style.css">
    </head>
    <body>

        <!-- ## TODO 到搜索搜索页面的链接 -->
        <a class="account-nav" href="">
            <span>我的畅校园</span>
        </a>

        <section class="account-part" id="account-borrowed">
            <h2>现在借阅了 <span class="account-borrowed">4</span> 本书</h2>

            <ul>
                <li>
                    <span class="account-bookname">JavaScript高级程序设计</span>
                    <span class="account-bookresidue">超期 <span class="error">9</span> 天 </span>
                    <span class="account-bookdate">2015-09-01</span>
                    <!-- ## TODO 需要在每个续借按钮上写上data-ctrlid属性，用来续借此书 -->
                    <span class="account-renew-btn account-renew-btn-disabled">续借</span>
                </li>
                <li>
                    <span class="account-bookname">深入浅出NodeJS</span>
                    <span class="account-bookresidue">剩余 <span class="warning">3</span> 天 </span>
                    <span class="account-bookdate">2015-09-11</span>
                    <span class="account-renew-btn">续借</span>
                </li>
                <li>
                    <span class="account-bookname">C++程序设计</span>
                    <span class="account-bookresidue">剩余 <span class="success">7</span> 天 </span>
                    <span class="account-bookdate">2015-09-16</span>
                    <span class="account-renew-btn">续借</span>
                </li>
                <li>
                    <span class="account-bookname">HTML5 Canvas核心技术</span>
                    <span class="account-bookresidue">剩余 <span class="success">14</span> 天 </span>
                    <span class="account-bookdate">2015-09-23</span>
                    <span class="account-renew-btn">续借</span>
                </li>
            </ul>
        </section>

        <section class="account-part" id="account-collected">
            <h2>已经收藏了 <span class="account-borrowed">3</span> 本书</h2>

            <ul>
                <li>
                    <span class="account-bookname">JavaScript高级程序设计</span>
                    <span class="account-bookmeta">ISBN: 9762549785648</span>
                    <span class="account-bookmeta">索书号: TCP/7638</span>
                    <span class="account-bookmeta">长安校区：计算机书库 共 5 本，3 本可借</span>
                    <span class="account-bookmeta">雁塔校区：社科书库 共 2 本，1 本可借</span>
                </li>
                <li>
                    <span class="account-bookname">深入浅出NodeJS</span>
                    <span class="account-bookmeta">ISBN: 9762549785648</span>
                    <span class="account-bookmeta">索书号: TCP/7638</span>
                    <span class="account-bookmeta">长安校区：计算机书库 共 5 本，3 本可借</span>
                    <span class="account-bookmeta">雁塔校区：社科书库 共 2 本，1 本可借</span>
                </li>
                <li>
                    <span class="account-bookname">C++程序设计</span>
                    <span class="account-bookmeta">ISBN: 9762549785648</span>
                    <span class="account-bookmeta">索书号: TCP/7638</span>
                    <span class="account-bookmeta">长安校区：计算机书库 共 5 本，3 本可借</span>
                    <span class="account-bookmeta">雁塔校区：社科书库 共 2 本，1 本可借</span>
                </li>
            </ul>
        </section>

        <footer>Copyright© 2012-2015 CreatShare All Rights Reserved</footer>

        <script src="js/zepto.min.js"></script>
        <script>
        !(function( $ ){

            $( '.account-renew-btn' ).on('click', function(){

                if( $( this ).hasClass( 'account-renew-btn-disabled' ) ){
                    return false;
                }

                if( $( this ).attr( 'data-lock' ) === 'true' ){
                    return false;
                }

                $( this ).attr( 'data-lock', 'true' );

                var ctrlid = $( this ).attr( 'data-ctrlid' ),
                    username = $( 'body' ).attr( 'data-username' );

                $.ajax({
                    'url': 'http://test.changxiaoyuan.com/index.php',
                    'dataType': 'jsonp',
                    'data': {
                        'username': username,
                        'ctrlid': ctrlid,
                        'do': 'renew'
                    },
                    'success': function( data ){
                        alert( data.msg );
                    }
                })

            });

        })( Zepto );
        </script>
    </body>
</html>
